import request from '@/utils/request'

// 司机登录方法
export function driverLogin(phone, password, code, uuid) {
  const data = {
    phone,
    password,
    code,
    uuid
  }
  return request({
    url: '/driver/api/v1/login/login_auth',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

// 经理登录方法
export function mangerLogin(phone, password, code, uuid) {
  const data = {
    phone,
    password,
    code,
    uuid
  }
  return request({
    url: '/manger/api/v1/login/login_auth',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

// 注册方法
export function register(data) {
  return request({
    url: '/register',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/rolemenu/api/v1/role_menu/getUserInfo',
    method: 'get'
  })
}
//保存管理员信息
export function saveAdminInfo(adminInfo) {
  return request({
    url:"/admin/updateAdminInfo",
    method:"put",
    data : adminInfo
  });
}
// 退出方法
export function driverLogout() {
  return request({
    url: '/driver/api/v1/login/logout',
    method: 'post'
  })
}

export function mangerLogout() {
  return request({
    url: '/manger/api/v1/login/logout',
    method: 'post'
  })
}

// 获取验证码
export function getCodeImg() {
  return request({
    url: '/captchaImage',
    headers: {
      isToken: false
    },
    method: 'get',
    timeout: 20000
  })
}
